<template>
	<div>
		<item-type-a v-if="itemType == 'A'" :styleConfig="styleConfig" :buttonActive="buttonActive">
		</item-type-a>
		<item-type-b v-if="itemType == 'B'" :styleConfig="styleConfig" :buttonActive="buttonActive" :comInfor="translateDetailData(detail)">
		</item-type-b>
		<item-type-c v-if="itemType == 'C'" 
			:styleConfig="styleConfig" 
			:buttonActive="buttonActive" 
			:comInfor="translateDetailData(detail)" 
			:moreseedata="moreseedata">
		</item-type-c>
		<item-type-d v-if="itemType == 'D'" :styleConfig="styleConfig" :buttonActive="buttonActive" :comInfor="translateDetailData(detail)">

		</item-type-d>
		<item-type-e v-if="itemType == 'E' && mrender" :styleConfig="styleConfig" :buttonActive="buttonActive" :comInfor="translateDetailData(detail)">

		</item-type-e>

		<item-type-f v-if="itemType == 'F' && mrender" :styleConfig="styleConfig" :buttonActive="buttonActive" :comInfor="translateDetailData(detail)">

		</item-type-f>

		<item-type-g v-if="itemType == 'G' && mrender" :styleConfig="styleConfig" :buttonActive="buttonActive" :comInfor="translateDetailData(detail)">
		</item-type-g>

		<item-type-h v-if="itemType == 'H' && mrender" :styleConfig="styleConfig" :buttonActive="buttonActive" :comInfor="translateDetailData(detail)">
		</item-type-h>
		<item-type-i v-if="itemType == 'I' && mrender" :styleConfig="styleConfig" :buttonActive="buttonActive" :comInfor="translateDetailData(detail)">
		</item-type-i>
		<item-type-j v-if="itemType == 'J' && mrender" :styleConfig="styleConfig" :buttonActive="buttonActive" :comInfor="translateDetailData(detail)">
		</item-type-j>

	</div>
</template>

<script>
	import ItemTypeA from './ItemTypeA'
	import ItemTypeB from './ItemTypeB'
	import ItemTypeC from './ItemTypeC'
	import ItemTypeD from './ItemTypeD'
	import ItemTypeE from './ItemTypeE'
	import ItemTypeF from './ItemTypeF'
	import ItemTypeG from './ItemTypeG'
	import ItemTypeH from './ItemTypeH'
	import ItemTypeI from './ItemTypeI'
	import ItemTypeJ from './ItemTypeJ'

	import { translateDetailData } from '@/utils/TranslateDetailDate'

	export default {
		data() {
			return {
				mrender: true
			}
		},

		components: {
			ItemTypeA,
			ItemTypeB,
			ItemTypeC,
			ItemTypeD,
			ItemTypeE,
			ItemTypeF,
			ItemTypeG,
			ItemTypeH,
			ItemTypeI,
			ItemTypeJ
		},
		props: {
			itemType: {
				default: 'A',
				type: String,
			},
			styleConfig: {
				type: Object,
				default: () => {
					return {}
				}
			},
			detail: {
				type: Object,
				default: () => {
					return {}
				}
			},
			buttonActive: {
				default: null
			},
			moreseedata: {
				type: Object,
				default: () => {}
			}
		},
		watch: {
			detail(data) {
				// if(this.env == 'edit') {
				// 	console.log(data, '数据 走起')
				// 	this.mrender = false;
				// 	setTimeout(() => {
				// 		this.mrender = true;
				// 	}, 5);
				// }
			}
		},
		computed:{
			env() {
				return window.environment; // 获取是否是编辑状态
			},
		},
		methods: {
			translateDetailData
		}
	}
</script>

<style>

</style>